package program.conditions;

import item.*;
import program.*;

/**
 * A class concerning conditions for executing a command.
 *
 */
public abstract class Conditions extends ProgramElement {
	
	/**
	 * Initialise these new conditions with a line number.
	 *
	 */
	public Conditions(int lineNb) {
		super(lineNb);
	}
	
	/**
	 * Evaluates this conditions for a given robot.
	 *
	 * @param	robot
	 *		The robot for which the condition should be evaluated.
	 * @return      
	 *              | result == (robot != null) && (robot.getBoard() != null)
	 */
	public boolean evaluate(Robot robot) {
		return (robot != null) && (robot.getPosition().getBoard() != null);
	}
} 